﻿<script>
    var model = avalon.define({
        $id: "QYGGADD",
        ColumnData: [],
        modelData: { "GGTitle": "", "GGContent": "", "Files": "", "remark": "", "JSUser": "" },
    });
    function getdata() {
        var modelValue = JSON.stringify(model.modelData.$model);
        return { Action: "ADDQYGG", P1: modelValue };
    }
    var strId = ComFunJS.getQueryString("ID");
    avalon.ready(function () {
        $.getJSON('/API/FTAPI.ashx?Action=GETCOLUMNLIST', { P1: 6 }, function (resultData) {
            if (resultData.ErrorMsg == "") {
                model.ColumnData = resultData.Result;
                if (strId == null) {
                    model.modelData.remark = resultData.Result[0].TypeNO;
                }
            }
        })
        if (strId != null) {
            $.getJSON('/API/FTAPI.ashx?Action=GETQYGGMODEL', { P1: strId }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    model.modelData = resultData.Result;

                }
            })
        }

    })
</script>
<div class="form-horizontal" ms-controller="QYGGADD">
    <div class="form-group">
        <label class="col-xs-2 control-label">公告类别</label>
        <div class="col-xs-4">
            <select class="form-control " ms-duplex="modelData.remark" id="asdasd">
                <option ms-repeat-item="ColumnData" ms-attr-val="item.TypeNO" ms-attr-selected="item.TypeNO==modelData.remark?'selected':''">{{item.TypeNO}}</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">公告标题</label>
        <div class="col-xs-9">
            <input type="text" value="" class="form-control szhl_require" ms-duplex="modelData.GGTitle" id="qygg" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-xs-2 control-label">公告内容</label>
        <div class="col-xs-9">
            <textarea id="conNR" class="szhl_UEEDIT form-control szhl_require" ms-duplex="modelData.GGContent"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">通知人员</label>
        <div class="col-xs-9">
            <input type="text" value="" class="form-control  szhl_getPeoples" ms-duplex="modelData.JSUser" id="qygg2" />
            <p class="text-danger">默认全部人员均能收到通知</p>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">附件</label>
        <div class="col-xs-9">
            <input type="text" value="" class="szhl_Upload form-control" ms-duplex="modelData.Files" />
        </div>
    </div>
</div>